#ifndef OBJC_CONTEXT_H
#define OBJC_CONTEXT_H

#include <sobjc-commons/st.h>
#include "node.h"
#include "class.h"
#include "scope.h"

typedef struct objc_line_mark        *objc_line_mark_t;

struct objc_line_mark {
  int lineno;
  char *file;
  int flags;
  objc_line_mark_t prev;
  objc_line_mark_t next;
};

extern objc_scope_t objc_root_scope;
extern objc_scope_t objc_current_scope;
extern objc_line_mark_t objc_current_line_mark;
extern objc_line_mark_t objc_recorded_line_mark;
extern int objc_parsing_column;
extern st_table_t objc_objc_str_table;
extern int objc_nobjc_strs;
extern st_table_t objc_declared_class_table;
extern int objc_in_decl_spcr_list;
extern unsigned long objc_nsend_sites;

void objc_record_line_mark(int, const char *, int);
void objc_push_line_mark(int, const char *);
void objc_pop_line_mark();
void objc_push_token_prefix(const char *);
char *objc_shift_token_prefix();
void objc_begin_decl_spcr_list();
void objc_end_decl_spcr_list();

objc_node_t objc_parse_file(const char *);
void objc_write_init_code(const char *);

#endif /* OBJC_CONTEXT_H */
